package com.ruoyi.project.common.service.impl;

import com.ruoyi.project.common.mapper.CommonMapper;
import com.ruoyi.project.common.service.ICommonService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class CommonServiceImpl implements ICommonService {

    @Autowired
    CommonMapper commonMapper;

    @Override
    public int selectTableColumnMaxValue(String table, String column) {
        return selectTableColumnMaxValue(table, column, " 1 = 1 ");
    }

    @Override
    public int selectTableColumnMaxValue(String table, String column, String where) {
        Integer value = commonMapper.selectTableColumnMaxValue(table, column, where);
        if (value != null) {
            return value;
        }
        return 0;
    }
}
